package mh.entity;

/**
 * Defines whether or not a tile or an entity is damageable or not
 * 
 * @author Gianmarco Laggia
 * @author Alberto D'Este
 * 
 */
public interface IDamageable {

	/**
	 * @return false if for any reason the target can't be damaged
	 */
	public boolean isDamageable();

	/**
	 * Sets if an object can be damaged or if it is protected
	 * 
	 * @param damageable
	 *            True if it is damageable.
	 */
	public void setDamageable(boolean damageable);

	/**
	 * @return The actual value of the healh
	 */
	public double getActualHealth();

	/**
	 * @return The actual value of the healh
	 */
	public double getMaximumHealth();

	/**
	 * @param scale
	 *            Scale should be 100 or 255
	 * @return The percentual amount of damage
	 */
	public double getHealthRatio(int scale);

	/**
	 * Tells the target to handle a damage
	 * 
	 * @param damageAmount
	 *            The value of the damage, if the damage is below the threshold this method has no effects
	 */
	public void damage(Damage damageInflicted);

	/**
	 * Restore some health to the target
	 * 
	 * @param repairAmount
	 *            The value of health points to be added. If the total repair amount is greater than the total health
	 *            points lost, the health value will be set to the maximum level
	 */
	public void repair(int repairAmount);

	/**
	 * @return The actual state (generic) of the entity
	 */
	public EnumState getDamageState();

}
